import java.io.IOException;
import java.util.List;

import com.qq.open.qzone.bean.param.QqListAlbumParamBean;
import com.qq.open.qzone.bean.result.QqAlbumInfoBean;
import com.qq.open.qzone.bean.result.QqListAlbumResultBean;
import com.qq.open.qzone.photo.QqListAlbum;


public class TestListAlbum {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {

		QqListAlbumParamBean paramBean = new QqListAlbumParamBean();
		
		paramBean.setAccessToken("138F0112CC9B350B8AE00899CB47D489");
		
		paramBean.setOpenId("2D78AAACEAF41021180BEAA2A47871B8");
		
		QqListAlbum qqListAlbum = new QqListAlbum();
		
		QqListAlbumResultBean resultBean = qqListAlbum.getListAlbum(paramBean);
		
		
		if (resultBean.getErrorFlg()) {
			System.out.println("错误编号：" + resultBean.getErrorCode());
			System.out.println("错误信息：" + resultBean.getErrorMes());
		} else {
			List<QqAlbumInfoBean> albumInfoList = resultBean.getAlbumInfoList();
			
			for (QqAlbumInfoBean qqAlbumInfoBean : albumInfoList) {
				System.out.println(qqAlbumInfoBean.getAlbumId());
				System.out.println(qqAlbumInfoBean.getClassId());
				System.out.println(qqAlbumInfoBean.getCoverUrl());
				System.out.println(qqAlbumInfoBean.getCreateTime());
				System.out.println(qqAlbumInfoBean.getDesc());
				System.out.println(qqAlbumInfoBean.getName());
				System.out.println(qqAlbumInfoBean.getPicnum());
				System.out.println("------------------------------");
			}
		}
	}

}
